<template>
	<view>
		<input type="text"  placeholder="请输入" v-model="obj.name" name="" id="">
		<input type="text"  v-model="obj.age" name="" id="">
		<input type="text"  v-model="obj.gender" name="" id="">
		<input type="text"  v-model="obj.like" name="" id="">
		<button type="primary" size="mini" @click="onSubmit" :disabled="state2">提交</button>
	</view>
</template>

<script setup lang="ts">
	import { computed, ref } from 'vue';
	const obj = ref({
		name:"",
		age:"",
		gender:"",
		like:""
	})
	
	// console.log(obj.value);
	const state1 = computed(()=>{
		
		const allValues = Object.values(obj.value)
		// console.log(obj.value);
		// console.log(allValues);
		return !allValues.every(item => item )
	})
	
	const state2 = computed(()=>{
		
		const allValues = Object.values(obj.value)
		// console.log(obj.value);
		// console.log(allValues);
		return allValues.some(item => !item )
	})
	

</script>

<style scoped lang="scss">
	input{
		height: 30px;
		margin: 10px;
		background-color: #ccc;
		color: white;
		padding: 0 10px;
		box-sizing: border-box;
	}
</style>
